{% extends "messages/base_messages.html" %}


{% block title %}Message{% endblock %}
{% block body_class %}{{ block.super }} message_detail{% endblock %}


{% block content_title %}
  <h3>From: {{ message.from_user }}</h3>
  <h2>Subject: {{ message.subject }}</h2>
{% endblock %}


{% block content %}
  <div class="message_list">
    {% for thread_message in thread_list %}
      <div class="item{% if thread_message == message %} current{% endif %}">
        <h4>{{ thread_message.from_user }} <a href="{{ thread_message.get_absolute_url }}">{{ thread_message.subject|default:"No subject" }}</a> {{ thread_message.created|date }}</h4>
        <div class="body">
          {{ thread_message.message|linebreaks }}
          <p><a href="{% url messages:reply thread_message.pk %}">reply</a></p>
        </div>
      </div>
    {% empty %}
      <div class="item current">
        <h4>{{ message.from_user }} <a href="{{ message.get_absolute_url }}">{{ message.subject|default:"No subject" }}</a> {{ message.created|date }}</h4>
        <div class="body">
          {{ message.message|linebreaks }}
          <p><a href="{% url messages:reply message.pk %}">reply</a></p>
        </div>
      </div>
    {% endfor %}
  </div>
{% endblock %}
